Skip to main content

Commit Transaction

AutomatR.MSSQLDataBase.Database.CommitTransaction

The "Commit Transaction" activity in AutomatR for SQL Server databases facilitates the commitment of a transaction on the connected database. This activity is crucial for finalizing and applying changes made within a transaction, ensuring data integrity.

Properties

NameDescription
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Commit Transaction" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Commit Transaction" activity onto the workflow.
  2. Optionally, configure the delay for synchronization purposes.
  3. Ensure that the "Commit Transaction" activity is placed in the workflow after the sequence of database operations to be committed.

Example: Consider an example where a series of database operations need to be executed within a transaction, and the transaction is committed upon successful execution:

Start Transaction:
Connection: SqlConnectionVariable
Delay: 0

... Perform database operations within the transaction ...

If No Error Occurs:
Commit Transaction

In this example, the "Commit Transaction" activity is used to commit the transaction initiated by the "Start Transaction" activity. The transaction is committed if no errors occur, ensuring that all changes made within the transaction are applied to the database.